<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                template="/template_content_admin.xhtml">

  <ui:define name="conteudo">
    <h2>#{msg['adicionar_promocao']}</h2>
    <h:panelGroup id="messagePanel" layout="block">
            <h:messages errorClass="messagesErro" infoClass="messagesInfo" layout="table"/>
    </h:panelGroup>
    <h:form>
       <h:panelGrid columns="2" columnClasses="panelgridClass1, panelgridClass2">
            <f:facet name="header">
                <h:outputText value="Plebe rude!"/>
            </f:facet>
                    <h:outputText value="#{msg['validade']} (MM/dd/yyyy HH:mm:ss):"/>
                    <h:inputText styleClass="try" id="validade" value="#{promocao.promocao.validade}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputText value="#{msg['descricao']}:"/>
                    <h:inputTextarea styleClass="try" rows="4" cols="30" id="descricao" value="#{promocao.promocao.descricao}" title="Descricao" required="true" requiredMessage="The descricao field is required." />
                    <h:outputText value="#{msg['pratos']}:"/>
                    <h:selectManyListbox id="cardapioCollection" value="#{promocao.promocao.cardapioCollection}" title="CardapioCollection">
                        <c:forEach items="#{cardapio.listCardapio}" var="item">
                            <f:selectItem itemValue="#{item.id}" itemLabel="#{item.produto}"/>
                            <f:converter converterId ="converterCardapio" />
                        </c:forEach>
                    </h:selectManyListbox>

                </h:panelGrid>
                <h:panelGrid columns="2">
                    <h:commandButton id="add" styleClass="buttonK" value="#{msg['adicionar']}" action="#{promocao.create}"/>
                    <h:commandButton id="list" styleClass="buttonK" value="#{msg['listar']}" action="#{promocao.listarPromocao}" immediate="true"/>
                </h:panelGrid>
    </h:form>
    </ui:define>

</ui:composition>

